<template>
  <div class="dashboard-container">
    <div class="dashboard-text">name: {{ name }}</div>
    <el-button type="primary" @click="onSubmit">立即创建</el-button>
  </div>
</template>

<script>
import { mapGetters } from "vuex"
import { addIps } from "@/api/table"

export default {
  name: "Dashboard",
  data(){
    return  {
      form:{
        ip:'222',
        dueTime:'222222',
        lastTime:'33333333'
      }
    }
  },
  computed: {
    ...mapGetters(["name"]),
  },
  methods: {
    onSubmit() {
      console.log(this.form)
      // let sid=localStorage.sid;
      // let user=localStorage.username
      addIps({
        ip: this.form.ip,
        pay_warning_time: this.form.dueTime,
        add_time: this.form.lastTime
        // sid:localStorage.sid,
        // user:user
      }).then((res) => {
        console.log('请求成功')
      })
    },
  },
}
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
</style>
